home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-27 | 1.1 KB | 54 lines | [TEXT/CWIE] |
- #include "doXCMDPlusPlus.h"
- #include "xcmdWind.h"
-
- //•••••••
- // Do our business
- //•••••••
-
- void
- doXCMDPlusPlus( XCmdPtr paramPtr )
- {
- xcmdWindow xWind( paramPtr );
-
- xWind.returnNil(); // assume no problems. (perhaps a bad name, it doesn't return,
- // it just sets the return value to nil.)
- try {
-
- if ( xWind.isWindowEvent() ) { // with xWindow objects always ask this question first.
- xWind.doWindowEvent();
- }
-
-
- else { // otherwise process as a command.
-
- xcmdString param( xWind[0] );
-
- if ( param == "OPEN" ) {
- Rect theRect = {10,10,50,90};
- xcmdString title( "Useless Window" );
- CWindowPtr cw =
- xWind.createWindow( theRect, title, 0 );
-
- if ( cw == nil ) throw xcmdString( "Out of Memory, cannot create window." );
- }
-
- else
- if ( param == "!" ) {
- xWind.returnMsg( "My wicked xcmd! ©Paul B. Beeken, Knowledge Software Consulting." );
- }
-
- else
- if ( param == "?" ) {
- xWind.returnMsg( "dummyXCMD Open" );
- }
-
- else throw xcmdString( "Bad command: " ) & param;
-
- } // else
-
- } // try block
-
- catch ( xcmdString s ) {
- xWind.errorMsg( s );
- }
- }